/*
 * @FilePath: \Src\App\inc\app_timer.h
 * @Description: 
 * 
 * Copyright (c) 2025 by ${w}, All Rights Reserved. 
 */

#ifndef APP_TIMER_H
#define APP_TIMER_H

/* 系统时间戳频率 */
#define SYSTEM_CLOCK_HZ 1000
/* 将对应的ms数转换为对应的系统时间 */
#define pdMS_TO_TICK(xTimeTick) (((uint64_t)xTimeTick) / (1000 / SYSTEM_CLOCK_HZ))

typedef struct
{
    uint64_t System_Ticks; /* 系统时间 2^64*10ms = 184467440737095516160ms = 184467440737095516.160s ≈ 5849424173550年 */
    uint8_t System_10ms : 1;      /* 10ms标志位*/
    uint8_t System_500ms : 1;      /* 500ms标志位*/
    uint8_t System_2s : 1;        /* 2s标志位*/
    uint8_t System_3s : 1;        /* 3s标志位*/
    uint8_t System_4s :1 ;        /* 4s标志位*/
} sys_timer_t;

extern sys_timer_t sys_timer;

void system_timer_init(void);
uint64_t system_GetTick(void);

#endif // !APP_TIMER_H
